import 'package:flutter/material.dart';
import 'package:flutter_app/ui/collect/CollectListModel.dart';
import 'package:get/get.dart';
import 'package:provider/provider.dart';

import '../CollectListPage.dart';
import 'collect_state.dart';

class CollectLogic extends GetxController with GetSingleTickerProviderStateMixin {
  final CollectState state = CollectState();

  late TabController controller;

  late List<Widget> widgets = [];


  @override
  void onInit() {
    super.onInit();
    controller = new TabController(length: state.tabs.length, vsync: this);
    for (int i = 0; i < state.tabs.length; i++) {
      widgets.add(new MultiProvider(
        providers: [ChangeNotifierProvider(create: (_) => CollectListModel())],
        child: CollectListPage(title: '采集列表', page: i.toString()),
      ));
    }
  }

  @override
  void onReady() {
    super.onReady();
  }

  @override
  void onClose() {
    super.onClose();
    controller.dispose();
  }
}
